package com.ZeroCarbon.controller;

import com.ZeroCarbon.service.TokenService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Token信息控制器
 *
 * @since 2025-7-20
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/general")
public class TokenController {

    private final TokenService tokenService;

    /**
     * 更新Access Token
     */
    @GetMapping("/updateAccessToken")
    public String updateToken(HttpServletRequest request, HttpServletResponse response) {
        return tokenService.updateAccessToken(request, response);
    }
}
